package com.woupla.model;

import java.io.Serializable;
import java.lang.Integer;
import java.lang.String;
import java.util.ArrayList;
import java.util.List;

import javax.enterprise.inject.New;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

/**
 * Entity implementation class for Entity: Company
 * 
 */
@NamedQueries(
		{ @NamedQuery(name = "findAllCity", query = "SELECT c FROM City c ") ,
		 @NamedQuery(name = "findAllCityInDep", query = "SELECT c FROM City c, Departement d where d.label like :dep ") ,
		 @NamedQuery(name = "findAllCityInReg", query = "SELECT c FROM City c") }
		)
@Entity
public class City implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4714055814360473722L;

	@Id
	@GeneratedValue
	private Integer id;
	@NotNull
	@NotEmpty
	private String label;
	@NotNull
	@NotEmpty
	private String codeINSEE;
	@NotNull
	@NotEmpty
	private String codePostal;
	@ManyToOne
	@JoinColumn(referencedColumnName="id")
	private Departement departement;

	/**
	 * @return the id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * @return the codeINSEE
	 */
	public String getCodeINSEE() {
		return codeINSEE;
	}

	/**
	 * @param codeINSEE
	 *            the codeINSEE to set
	 */
	public void setCodeINSEE(String codeINSEE) {
		this.codeINSEE = codeINSEE;
	}

	/**
	 * @return the codePostal
	 */
	public String getCodePostal() {
		return codePostal;
	}

	/**
	 * @param codePostal
	 *            the codePostal to set
	 */
	public void setCodePostal(String codePostal) {
		this.codePostal = codePostal;
	}

	/**
	 * @return the departement
	 */
	public Departement getDepartement() {
		return departement;
	}

	/**
	 * @param departement
	 *            the departement to set
	 */
	public void setDepartement(Departement departement) {
		this.departement = departement;
	}

	/**
	 * @return the label
	 */
	public String getLabel() {
		return label;
	}

	/**
	 * @param label the label to set
	 */
	public void setLabel(String label) {
		this.label = label;
	}

}
